package com.freewater.springboot.demo.ioc.lookupmethodinject;

/**
 * createCommand也可以是普通方法，但是需要提供假实现
 */
public abstract class AbstractCommandManager {

    public void process(Object commandState) {
        final Command command = createCommand();
        command.setState(commandState);
        command.execute();
    }

    // 方法签名必须是：<public|protected> [abstract] <return-type> theMethodName(no-arguments); 才能使用method injection机制
    protected abstract Command createCommand();

}
